package com.sinacom.ibuilding.dao.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.sinacom.ibuilding.beans.Message;
import com.sinacom.ibuilding.beans.Sms;
import com.sinacom.ibuilding.dao.iface.MessageDao;

public class MessageDaoImpl extends SqlMapDaoTemplate implements MessageDao{
	
	public MessageDaoImpl(DaoManager daoManager){
		super(daoManager);
	}
	
	

	public List getMessageList(Map map) {
	    return queryForList("getMessageList", map);
    }

	

    public int getMessageListCount(Map map) {
    	Object obj = queryForObject("getMessageListCount", map);
		return obj==null?0:((Integer)obj).intValue();
	}



	public void insertMessage(Message message) {
		Date now = new Date();
		message.setCreateDate(now);
		message.setModifyDate(now);
        insert("insertMessage", message);
    }



    public void updateMessage(Message message) {
        update("updateMessage", message);
    }



    public void deleteMessage(Map map) {
        delete("deleteMessage", map);
    }



	public List getSmsList(Map map) {
		return queryForList("getSmsList", map);
	}



	public void insertSms(Sms sms) {
		insert("insertSms", sms);
	}



	public void updateSms(Sms sms) {
		
	}

    public void deleteSms(Map map){
    	delete("deleteSms", map);
    }
	
	
}
